Skip to content

fix: remove password-length from credential logs and harden view definition parsing#1469

Open
tomaioo wants to merge 5 commits into
databricks:mainfrom
tomaioo:fix/security/sensitive-information-exposure-in-creden
Open

fix: remove password-length from credential logs and harden view definition parsing#1469
tomaioo wants to merge 5 commits into
databricks:mainfrom
tomaioo:fix/security/sensitive-information-exposure-in-creden

Conversation

@tomaioo

@tomaioo tomaioo commented May 20, 2026

Copy link
Copy Markdown

Summary

Two small fixes: stop logging password-length metadata in CredentialShardEvent, and make view-definition parsing more robust against empty or malformed DESCRIBE output.

Changes

credential_events.py — stop logging password metadata

CredentialShardEvent previously logged password character count. That metadata can aid offline guessing even though the password itself is not logged. The event message is now a static "Sharding credentials" string with no password-related fields.

Scope note: CredentialLoadError and CredentialSaveError are unchanged in this PR. Redacting file paths in those error messages is a separate follow-up if needed.

query.py — defensive view-definition parsing

  • Use startswith/endswith instead of index access when stripping parentheses from view_definition, avoiding IndexError on empty strings.
  • Guard against malformed "View Text" rows in DescribeQueryProcessor with a clearer DbtRuntimeError.

These are robustness improvements to metadata parsing, not SQL injection mitigation.

tomaioo added 2 commits May 19, 2026 23:09
- Security: Sensitive Information Exposure in Credential Events
- Security: SQL Query Construction Without Parameterization in QueryProcessor

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Sensitive Information Exposure in Credential Events
- Security: SQL Query Construction Without Parameterization in QueryProcessor

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo tomaioo requested review from jprakash-db and sd-db as code owners May 20, 2026 06:09
The event is only consumed via __str__ for human-readable logs; no
state is needed after removing password-length metadata.
@sd-db sd-db changed the title fix(security): 2 improvements across 2 files fix: remove password-length from credential logs and harden view definition parsing Jun 17, 2026
sd-db added 2 commits June 17, 2026 14:03
Add unit tests for QueryProcessor empty view_definition handling and
DescribeQueryProcessor malformed DESCRIBE EXTENDED rows.

@sd-db sd-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thx for the PR !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants